<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/template.xhtml"
                xmlns:framework="http://java.sun.com/jsf/composite/components">
    <ui:define name="head">

    </ui:define>
    <ui:define name="content">
        <h:form id="setting_form" prependId="false">
            <framework:dataTable id="setting" formDialogId="setting"
                                 headText="#{msg['blog']['settingManagement']}"
                                 value="#{viewScope.list}"
                                 singleSelection="#{viewScope.sinSelected}"
                                 multipleSelection="#{viewScope.mulSelected}">

                <p:column field="code" headerText="#{msg['blog']['code']}"/>
                <p:column field="name" headerText="#{msg['blog']['name']}"/>
                <p:column field="type" headerText="#{msg['blog']['type']}"/>
                <p:column field="global" headerText="#{msg['blog']['global']}"/>

            </framework:dataTable>
        </h:form>
    </ui:define>
    <ui:define name="dialog">
        <h:form id="dialog_form">
            <framework:dialog id="setting" value="#{viewScope.vo}"
                              saveUpdate="@widgetVar(setting_dataTable)">

                <framework:label target="name" value="#{msg['blog']['name']}" styleClass="p-col-6">
                    <p:inputText id="name" value="#{viewScope.vo.name}" required="true"/>
                </framework:label>

                <framework:label target="code" value="#{msg['blog']['code']}" styleClass="p-col-6">
                    <p:inputText id="code" value="#{viewScope.vo.code}" required="true"/>
                </framework:label>

                <framework:label target="inputType" value="#{msg['blog']['inputType']}" styleClass="p-col-6">
                    <p:selectOneMenu value="#{viewScope.vo.type}" converter="inputTypeConverter">
                        <f:selectItems value="#{viewScope.types}" var="type" itemLabel="#{type.title}"
                                       itemValue="#{type}"/>
                    </p:selectOneMenu>
                </framework:label>


                <framework:label target="global" value="#{msg['blog']['global']}" styleClass="p-col-6">
                    <p:selectOneRadio value="#{viewScope.vo.global}">
                        <f:selectItem itemValue="#{null}" itemLabel="#{msg['framework']['all']}"/>
                        <f:selectItem itemValue="#{true}" itemLabel="#{msg['framework']['yes']}"/>
                        <f:selectItem itemValue="#{false}" itemLabel="#{msg['framework']['no']}"/>
                    </p:selectOneRadio>
                </framework:label>

                <framework:label target="options" value="#{msg['blog']['options']}" styleClass="p-col-6">
                    <p:selectOneMenu value="#{viewScope.vo.options}">
                        <f:selectItem itemLabel="#{msg['framework']['pleaseChoose']}"
                                      itemValue="#{null}"/>
                        <f:selectItems value="#{viewScope.dictNodes}" var="dict" itemLabel="#{dict.name}"
                                       itemValue="#{dict.code}"/>
                    </p:selectOneMenu>
                </framework:label>
            </framework:dialog>
        </h:form>
    </ui:define>
</ui:composition>